CREATE TABLE [dbo].[TTSUBR_FINA]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_ARUB] [dbo].[TD_VC_003] NOT NULL,
[CO_RUBR] [dbo].[TD_VC_003] NOT NULL,
[CO_SUBR] [dbo].[TD_VC_003] NOT NULL,
[DE_SUBR] [dbo].[TD_VC_100] NULL,
[NU_ORDE] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TTSUBR_FI__NU_OR__18777F3D] DEFAULT ((0)),
[ST_REPO] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TTSUBR_FI__ST_RE__196BA376] DEFAULT ('N'),
[ST_PROY] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TTSUBR_FI__ST_PR__1B53EBE8] DEFAULT ('N'),
[ST_EJEC] [dbo].[TD_VC_001_SINO] NULL CONSTRAINT [DF__TTSUBR_FI__ST_EJ__1D3C345A] DEFAULT ('N'),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTSUBR_FI__CO_US__1F247CCC] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTSUBR_FI__FE_US__2018A105] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTSUBR_FI__CO_US__210CC53E] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTSUBR_FI__FE_US__2200E977] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTSUBR_FINA] WITH NOCHECK ADD CONSTRAINT [CK__TTSUBR_FI__ST_EJ__1E305893] CHECK NOT FOR REPLICATION (([ST_EJEC]='N' OR [ST_EJEC]='S'))
GO
ALTER TABLE [dbo].[TTSUBR_FINA] WITH NOCHECK ADD CONSTRAINT [CK__TTSUBR_FI__ST_PR__1C481021] CHECK NOT FOR REPLICATION (([ST_PROY]='N' OR [ST_PROY]='S'))
GO
ALTER TABLE [dbo].[TTSUBR_FINA] WITH NOCHECK ADD CONSTRAINT [CK__TTSUBR_FI__ST_RE__1A5FC7AF] CHECK NOT FOR REPLICATION (([ST_REPO]='N' OR [ST_REPO]='S'))
GO
ALTER TABLE [dbo].[TTSUBR_FINA] ADD CONSTRAINT [PK__TTSUBR_F__186907AA0A695708] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_ARUB], [CO_RUBR], [CO_SUBR]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTSUBR_FINA] ADD CONSTRAINT [FK__TTSUBR_FINA__6F16424E] FOREIGN KEY ([CO_EMPR], [CO_ARUB], [CO_RUBR]) REFERENCES [dbo].[TTRUBR_FINA] ([CO_EMPR], [CO_ARUB], [CO_RUBR])
GO
